/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.zjdt.epserver.db.service4mysql;

import com.zjdt.epserver.db.dao.FactoryDao;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;

/**
 *
 * @author dusin
 */
public class FactoryServiceImpl {
    static Logger logger = Logger.getLogger(FactoryServiceImpl.class);
    FactoryDao factoryDao;

    public FactoryServiceImpl(FactoryDao factoryDao) {
        this.factoryDao = factoryDao;
    }    
    
    public List<Map<String,Object>> findAll(){
        return factoryDao.findAll();
    }  
    
    public boolean create(String code,String name,String address,double longitude,double latitude,
            String typeCode,String plateStart){
        return factoryDao.doCreate(new Object[]{code,name,address,longitude,latitude,typeCode,plateStart}); //默认密码888888
    }
    
    public boolean update(int id,String code,String name,String address,
            String typeCode,String plateStart){
        return factoryDao.doUpdateById(new Object[]{code,name,address,typeCode,plateStart,id});
    }
    
    public boolean remove(int id){
        return factoryDao.doDeleteById(id);
    }    
    
    public List<Map<String,Object>> findAll4Combo(){
        return factoryDao.findAll4Combo();
    }
}
